# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Sheila Aman <sheila@vulpine.house>
# Maintainer: Sheila Aman <sheila@vulpine.house>
pkgname=lynx
pkgver=2.9.2
_relver=${pkgver/_p/rel.}
pkgrel=0
pkgdesc="Cross-platform text-based browser"
url="https://lynx.invisible-island.net/"
arch="all"
license="GPL-2.0-only"
depends="gzip"
makedepends="openssl-dev>3 gettext zlib-dev glib-dev perl ncurses-dev"
subpackages="$pkgname-doc $pkgname-lang"
source="https://invisible-mirror.net/archives/lynx/tarballs/lynx$_relver.tar.bz2"
builddir="$srcdir"/$pkgname$_relver

# secfixes:
#   2.8.9_p1-r3:
#     - CVE-2021-38165

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-ipv6 \
		--with-ssl \
		--enable-default-colors \
		--with-screen=ncursesw \
		--with-zlib \
		--disable-full-paths \
		--enable-externs \
		--enable-nls
	make helpdir=/usr/share/doc/lynx/help \
		docdir=/usr/share/doc/lynx
}

check() {
	./lynx -version
}

package() {
	make DESTDIR="$pkgdir" install install-help install-doc \
		helpdir=/usr/share/doc/lynx/help \
		docdir=/usr/share/doc/lynx
}

sha512sums="
bb9ed23a5f8664ca8bccd95cc55683849aa707f601e209d84e0acaed151b78cd772316f527881022ff120049c4fc586c05d579f9d616a2b108d9ddfaa5b2159d  lynx2.9.2.tar.bz2
"
